{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "微信支付100元\n"
     ]
    }
   ],
   "source": [
    "from abc import abstractmethod,ABCMeta\n",
    "class payment(metaclass=ABCMeta):\n",
    "    @abstractmethod\n",
    "    def pay(self,money):\n",
    "        raise NOtImplementedError\n",
    "class alipy(payment):\n",
    "    def pay(self,money):\n",
    "        print('支付宝支付%s'%money)\n",
    "class applepay(payment):\n",
    "    def pay(self,money):\n",
    "        print('苹果支付%s元'%money)\n",
    "        \n",
    "class wechatpay():\n",
    "    def hauqian(self,a,b):\n",
    "        print('微信支付%s元'%(a+b))\n",
    "class realwechatpay(payment,wechatpay):\n",
    "    def pay(self,money):\n",
    "        return self.huaqian(money,0)\n",
    "class pavadepter(payment):\n",
    "    def __init__(self,payment):\n",
    "        self.payment=payment\n",
    "    def pay(self,money):\n",
    "        return self.payment.hauqian(money,0)\n",
    "pavadepter(wechatpay()).pay(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
